package com.project.bean;

import java.time.LocalDate;

/**
 * 宠物信息实体类
 */
public class PetInfoBean {
    /**宠物信息id*/
    private int id;
    /**宠物信息内容*/
    private String content;
    /**宠物信息发布时间*/
    private LocalDate date = LocalDate.now();
    /**宠物信息类别*/
    private String type;
    /**发布城市*/
    private String city;
    /**宠主对象*/
    private UserBean user;

    public PetInfoBean() {
    }

    public PetInfoBean(String content, LocalDate date, String type, String city, int userId) {
        this.content = content;
        this.date = date;
        this.type = type;
        this.city = city;
        this.user = new UserBean();
        this.user.setId(userId);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "PetInfo{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", type='" + type + '\'' +
                ", city='" + city + '\'' +
                ", user=" + user +
                '}';
    }
}
